package com.gitee.orderconsul.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName Test
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/12/18 13:54
 **/
@RestController
public class Test {

    @Autowired
    private RestTemplate template;

    private final String SERVICE_NAME ="http://payment-consul";

    @GetMapping("/consul/order")
    public String test(){
        return template.getForObject(SERVICE_NAME + "/payment/consul" ,String.class);
    }

}
